//
//  HWPersonalDataCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/10/21.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWPersonalDataCell.h"

@interface HWPersonalDataCell()<UITextFieldDelegate>
//@property(strong,nonatomic)UILabel  *nameLabel; // 名称
//@property(strong,nonatomic)UIImageView *arrowImageView; // 箭头
//@property(strong,nonatomic)UITextField *nametextField;  // 选择名称
@property(strong,nonatomic)UIView *fengexianView;

@end

@implementation HWPersonalDataCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
        
        
    }
    return  self;
    
}

//设置UI
-(void)setupUI {
    
    
    
    
    
      self.contentView.backgroundColor = RGB(247, 247, 247);
    
    
      self.baiseView  = [[UIView alloc]initWithFrame:CGRectMake(20, 10, kScreenW-40, 54)];
      self.baiseView.layer.cornerRadius = 8;
      self.baiseView.layer.masksToBounds = YES;
      self.baiseView.backgroundColor = [UIColor whiteColor];
      [self.contentView addSubview:self.baiseView];
    
    
    
   
    
    
    
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 200, 54)];
    self.nameLabel.text = @"头像";
    self.nameLabel.textColor = RGB(51, 51, 51);
    self.nameLabel.font = [UIFont systemFontOfSize:14];
    [self.baiseView addSubview:self.nameLabel];
    
    
    self.nametextField = [[UITextField alloc]initWithFrame:CGRectMake(kScreenW-200-30-20, 10, 200, 54)];
    self.nametextField.font = [UIFont systemFontOfSize:12];
    self.nametextField.textColor = RGB(102, 102, 102);
     self.nametextField.textColor = RGB(68, 68, 68);
    self.nametextField.delegate = self;
    self.nametextField.text = @"好嗨哦";
    
//    NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:@"搜索" attributes:
//         @{NSForegroundColorAttributeName:RGB(102, 102, 102),
//           NSFontAttributeName:[UIFont boldSystemFontOfSize:12]}
//         ];
//    self.nametextField.attributedPlaceholder  = attrString;

    self.nametextField.textAlignment = NSTextAlignmentRight;
      [self.contentView addSubview: self.nametextField];
    
  //   [self.baiseView addSubview:self.nameLabel];
    
    
    
    self.arrowImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kScreenW-40-7-16,(54-16)/2, 16, 16)];
    self.arrowImageView.image = [UIImage imageNamed:@"jiantouzuobian"];
    [self.baiseView addSubview:self.arrowImageView];
    
    
    
    
    
    
    
    
    
    self.fengexianView = [[UIView alloc]initWithFrame:CGRectMake(0, 39, kScreenW, 1)];
    self.fengexianView.backgroundColor = RGB(232, 232, 242);
    self.fengexianView.hidden = YES;
    [self.contentView addSubview:self.fengexianView];
    
    
    
    
}


//不允许编辑
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
    NSLog(@"这里返回为NO。则为禁止编辑");
    return NO;
}

@end
